{extend name='admin@main'}
{block name="button"}
{if auth("remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些记录吗？" class='layui-btn layui-btn-sm layui-btn-primary'>删除记录</button>
{/if}
{/block}
{block name="content"}
<div class="think-box-shadow">
    {include file='recharge_record/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left'>用户</th>
            <th class="text-left">充值金额</th>
            <th class="text-left">转出地址</th>
            <th class="text-left">转入地址</th>
            <th class="text-left">交易Hash</th>
            <th class="text-left">时间</th>
            <th class="text-left">状态</th>
            <th class="text-left">操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left'>
                {$vo.username|default='--'}
            </td>
            <td class='text-left'>
                {$vo.money|number_format=3}&nbsp;USDT
            </td>
            <td class='text-left'>
                {$vo.from_addr|default='--'}
            </td>
            <td class='text-left'>
                {$vo.to_addr|default='--'}
            </td>
            <td class='text-left'>
                {$vo.hash|default='--'}
            </td>
            <td class='text-left'>
                {$vo.time|default='--'}
            </td>
            <td class='text-left'>
                {if $vo.status == 0}
                    充值中
                {/if}
                {if $vo.status == 1}
                <span class="color-green">已完成</span>
                {/if}
                {if $vo.status == 2}
                <span class="color-desc">充值失败</span>
                {/if}
                {if $vo.status == 3}
                <span class="color-desc">过期或取消</span>
                {/if}
            </td>
            <td class='text-left'>
                {if $vo.status eq 0}
                    {if auth("agree")}
                    <a class="layui-btn layui-btn layui-btn-xs" data-confirm="确定要同意充值吗？" data-action="{:url('agree')}" data-value="id#{$vo.id}" data-csrf="{:systoken('agree')}">手动同意</a>
                    {else}
                        <a data-tips-text="您没有同意的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">手动同意</a>
                    {/if}
                {/if}
                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删除</a>
                {else}
                    <a data-tips-text="您没有删除的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">删除</a>
                {/if}
            </td>

        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}
